﻿/*
 * 作者：新生命开发团队（http://www.newlifex.com/）
 * 
 * 版权：版权所有 (C) 新生命开发团队 2002-2014
 * 
 * 修改：海洋饼干（cuteant@outlook.com）
*/

using System;

namespace CuteAnt.Log
{
	/// <summary>日志接口</summary>
	public interface ILog
	{
		#region -- Write --

		/// <summary>写日志</summary>
		/// <param name="level">日志级别</param>
		/// <param name="msg">信息</param>
		void Write(LogLevel level, String msg);

		/// <summary>写带格式信息的日志</summary>
		/// <param name="level">日志级别</param>
		/// <param name="formatMsg">格式化字符串</param>
		/// <param name="args">格式化参数</param>
		void Write(LogLevel level, String formatMsg, params Object[] args);

		/// <summary>写异常日志</summary>
		/// <param name="level">日志级别</param>
		/// <param name="ex">异常</param>
		void Write(LogLevel level, Exception ex);

		/// <summary>写异常日志</summary>
		/// <param name="level">日志级别</param>
		/// <param name="ex">异常</param>
		/// <param name="msg">信息</param>
		void Write(LogLevel level, Exception ex, String msg);

		/// <summary>写带格式信息的异常日志</summary>
		/// <param name="level">日志级别</param>
		/// <param name="ex">异常</param>
		/// <param name="formatMsg">格式化字符串</param>
		/// <param name="args">格式化参数</param>
		void Write(LogLevel level, Exception ex, String formatMsg, params Object[] args);

		#endregion

		#region -- Debug --

		/// <summary>调试日志</summary>
		/// <param name="msg">调试信息</param>
		void Debug(String msg);

		/// <summary>带格式信息的调试日志</summary>
		/// <param name="formatMsg">格式化字符串</param>
		/// <param name="args">格式化参数</param>
		void Debug(String formatMsg, params Object[] args);

		#endregion

		#region -- Info --

		/// <summary>信息日志</summary>
		/// <param name="msg">信息</param>
		void Info(String msg);

		/// <summary>带格式信息的信息日志</summary>
		/// <param name="formatMsg">格式化字符串</param>
		/// <param name="args">格式化参数</param>
		void Info(String formatMsg, params Object[] args);

		#endregion

		#region -- Warn --

		/// <summary>警告日志</summary>
		/// <param name="msg">警告信息</param>
		void Warn(String msg);

		/// <summary>带格式信息的警告日志</summary>
		/// <param name="formatMsg">格式化字符串</param>
		/// <param name="args">格式化参数</param>
		void Warn(String formatMsg, params Object[] args);

		#endregion

		#region -- Error --

		/// <summary>错误日志</summary>
		/// <param name="msg">错误信息</param>
		void Error(String msg);

		/// <summary>带格式信息的错误日志</summary>
		/// <param name="formatMsg">格式化字符串</param>
		/// <param name="args">格式化参数</param>
		void Error(String formatMsg, params Object[] args);

		/// <summary>错误日志</summary>
		/// <param name="ex">异常</param>
		void Error(Exception ex);

		/// <summary>错误日志</summary>
		/// <param name="ex">异常</param>
		/// <param name="msg">信息</param>
		void Error(Exception ex, String msg);

		/// <summary>带格式信息的错误日志</summary>
		/// <param name="ex">异常</param>
		/// <param name="formatMsg">格式化字符串</param>
		/// <param name="args">格式化参数</param>
		void Error(Exception ex, String formatMsg, params Object[] args);

		#endregion

		#region -- Fatal --

		/// <summary>严重错误日志</summary>
		/// <param name="msg">严重错误信息</param>
		void Fatal(String msg);

		/// <summary>带格式信息的严重错误日志</summary>
		/// <param name="formatMsg">格式化字符串</param>
		/// <param name="args">格式化参数</param>
		void Fatal(String formatMsg, params Object[] args);

		/// <summary>严重错误日志</summary>
		/// <param name="ex">异常</param>
		void Fatal(Exception ex);

		/// <summary>严重错误日志</summary>
		/// <param name="ex">异常</param>
		/// <param name="msg">信息</param>
		void Fatal(Exception ex, String msg);

		/// <summary>带格式信息的严重错误日志</summary>
		/// <param name="ex">异常</param>
		/// <param name="formatMsg">格式化字符串</param>
		/// <param name="args">格式化参数</param>
		void Fatal(Exception ex, String formatMsg, params Object[] args);

		#endregion

		/// <summary>日志等级，只输出大于等于该级别的日志</summary>
		LogLevel Level { get; set; }
	}
}